<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="TOKN">﻿</span><span class="COMM">//------------------------------------------------------------------------------</span><span class="WHIT">
<span class='line'>  2</span> </span><span class="COMM">// File: jamActions.jsxinc</span><span class="WHIT">
<span class='line'>  3</span> </span><span class="COMM">// Version: 3.3</span><span class="WHIT">
<span class='line'>  4</span> </span><span class="COMM">// Release Date: 2012-10-21</span><span class="WHIT">
<span class='line'>  5</span> </span><span class="COMM">// Copyright: © 2011-2012 Michel MARIANI &lt;http://www.tonton-pixel.com/blog/></span><span class="WHIT">
<span class='line'>  6</span> </span><span class="COMM">// Licence: GPL &lt;http://www.gnu.org/licenses/gpl.html></span><span class="WHIT">
<span class='line'>  7</span> </span><span class="COMM">//------------------------------------------------------------------------------</span><span class="WHIT">
<span class='line'>  8</span> </span><span class="COMM">// This program is free software: you can redistribute it and/or modify</span><span class="WHIT">
<span class='line'>  9</span> </span><span class="COMM">// it under the terms of the GNU General Public License as published by</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="COMM">// the Free Software Foundation, either version 3 of the License, or</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="COMM">// (at your option) any later version.</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="COMM">// </span><span class="WHIT">
<span class='line'> 13</span> </span><span class="COMM">// This program is distributed in the hope that it will be useful,</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="COMM">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="COMM">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="COMM">// GNU General Public License for more details.</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="COMM">// </span><span class="WHIT">
<span class='line'> 18</span> </span><span class="COMM">// You should have received a copy of the GNU General Public License</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="COMM">// along with this program.  If not, see &lt;http://www.gnu.org/licenses/>.</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="COMM">//------------------------------------------------------------------------------</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="COMM">// Version History:</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="COMM">//  3.3:</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="COMM">//  - Initial release.</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="COMM">//------------------------------------------------------------------------------</span><span class="WHIT">
<span class='line'> 25</span> 
<span class='line'> 26</span> </span><span class="COMM">/**
<span class='line'> 27</span>  * @fileOverview
<span class='line'> 28</span>  * @name jamActions.jsxinc
<span class='line'> 29</span>  * @author Michel MARIANI
<span class='line'> 30</span>  */</span><span class="WHIT">
<span class='line'> 31</span> 
<span class='line'> 32</span> </span><span class="COMM">//------------------------------------------------------------------------------</span><span class="WHIT">
<span class='line'> 33</span> 
<span class='line'> 34</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.jamActions</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'> 37</span>      * Global object (used to simulate a namespace in JavaScript) containing
<span class='line'> 38</span>      * a set of functions related to decoding actions files into a format usable by scripts written with the
<span class='line'> 39</span>      * &lt;a href="http://www.tonton-pixel.com/blog/json-action-manager/">JSON Action Manager&lt;/a> engine.&lt;br />
<span class='line'> 40</span>      * Uses information found in the document
<span class='line'> 41</span>      * &lt;a href="http://www.tonton-pixel.com/Photoshop%20File%20Formats/actions-file-format.html">Photoshop Actions File Format&lt;/a>.
<span class='line'> 42</span>      * @author Michel MARIANI
<span class='line'> 43</span>      * @version 3.3
<span class='line'> 44</span>      * @namespace
<span class='line'> 45</span>      */</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">    </span><span class="NAME">this.jamActions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">    </span><span class="COMM">//</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">    </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'> 51</span>          * @description Test if a given file is an actions file (*.atn).
<span class='line'> 52</span>          * @param {Object} file File object
<span class='line'> 53</span>          * @returns {Boolean} true if actions file
<span class='line'> 54</span>          * @example
<span class='line'> 55</span>          * function actionsFileFilter (f)
<span class='line'> 56</span>          * {
<span class='line'> 57</span>          *     return (f instanceof Folder) || jamActions.&lt;strong>isActionsFile&lt;/strong> (f);
<span class='line'> 58</span>          * }
<span class='line'> 59</span>          * var select = (File.fs === "Macintosh") ? actionsFileFilter : "Actions Files:*.atn,All Files:*";
<span class='line'> 60</span>          * var actionsFile = File.openDialog ("Select an actions file:", select);
<span class='line'> 61</span>          * if (actionsFile !== null)
<span class='line'> 62</span>          * {
<span class='line'> 63</span>          *     alert ("OK!");
<span class='line'> 64</span>          * }
<span class='line'> 65</span>          */</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT">        </span><span class="NAME">jamActions.isActionsFile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file.type</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'8BAC'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">file.name.match</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/\.atn$/i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">        </span><span class="COMM">//</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'> 72</span>          * @description Test if a given file is an actions palette file (Actions Palette.psp).
<span class='line'> 73</span>          * @param {Object} file File object
<span class='line'> 74</span>          * @returns {Boolean} true if actions palette file
<span class='line'> 75</span>          * @example
<span class='line'> 76</span>          * function actionsPaletteFilter (f)
<span class='line'> 77</span>          * {
<span class='line'> 78</span>          *     return (f instanceof Folder) || jamActions.&lt;strong>isActionsPalette&lt;/strong> (f);
<span class='line'> 79</span>          * }
<span class='line'> 80</span>          * var select = (File.fs === "Macintosh") ? actionsPaletteFilter : "Actions Palette File:*.psp,All Files:*.*";
<span class='line'> 81</span>          * var actionsPaletteFile = File.openDialog ("Select an actions palette file:", select);
<span class='line'> 82</span>          * if (actionsPaletteFile !== null)
<span class='line'> 83</span>          * {
<span class='line'> 84</span>          *     alert ("OK!");
<span class='line'> 85</span>          * }
<span class='line'> 86</span>          */</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">        </span><span class="NAME">jamActions.isActionsPalette</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">File.decode</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file.name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">file.type</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'8BPF'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">fName.match</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/^Actions Palette$/i</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">fName.match</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/^Actions Palette.psp$/i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">        </span><span class="COMM">//</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'> 94</span>          * @description Convert an actions file (*.atn) or actions palette file (Actions Palette.psp) into a data structure
<span class='line'> 95</span>          * in literal object format [available in CS2 or later].
<span class='line'> 96</span>          * @param {String|Object} actionsFile Actions file (or actions palette file) path string or File object
<span class='line'> 97</span>          * @param {Boolean} [isPalette] true if actions palette file
<span class='line'> 98</span>          * @returns {Object|String} Converted actions file data structure in literal object format, or error message string
<span class='line'> 99</span>          * &lt;p style="margin: 0.5em 0 0 0em;">
<span class='line'>100</span>          * The actions file data structure is defined as a literal object with two members: either&lt;br />
<span class='line'>101</span>          * &lt;code>{ fileVersion: &lt;em>fileVersion&lt;/em>, actionSets: &lt;em>actionSets&lt;/em> }&lt;/code> for an actions palette file, or &lt;br />
<span class='line'>102</span>          * &lt;code>{ fileVersion: &lt;em>fileVersion&lt;/em>, actionSet: &lt;em>actionSet&lt;/em> }&lt;/code> for an actions file.
<span class='line'>103</span>          * &lt;/p>
<span class='line'>104</span>          * &lt;p style="margin: 0.5em 0 0 1.25em;">
<span class='line'>105</span>          * &lt;code>&lt;em>fileVersion&lt;/em>&lt;/code>: number&lt;br />
<span class='line'>106</span>          * &lt;code>&lt;em>actionSets&lt;/em>&lt;/code>: literal array [ ] of &lt;code>&lt;em>actionSet&lt;/em>&lt;/code>&lt;br />
<span class='line'>107</span>          * &lt;code>&lt;em>actionSet&lt;/em>&lt;/code>: literal object with three members:
<span class='line'>108</span>          * &lt;code>{ name: &lt;em>name&lt;/em>, expanded: &lt;em>expanded&lt;/em>, actions: &lt;em>actions&lt;/em> }&lt;/code>
<span class='line'>109</span>          * &lt;/p>
<span class='line'>110</span>          * &lt;p style="margin: 0.5em 0 0 2.5em;">
<span class='line'>111</span>          * &lt;code>&lt;em>name&lt;/em>&lt;/code>: string&lt;br />
<span class='line'>112</span>          * &lt;code>&lt;em>expanded&lt;/em>&lt;/code>: boolean&lt;br />
<span class='line'>113</span>          * &lt;code>&lt;em>actions&lt;/em>&lt;/code>: literal array [ ] of &lt;code>&lt;em>action&lt;/em>&lt;/code>
<span class='line'>114</span>          * &lt;/p>
<span class='line'>115</span>          * &lt;p style="margin: 0.5em 0 0 3.75em;">
<span class='line'>116</span>          * &lt;code>&lt;em>action&lt;/em>&lt;/code>: literal object with seven members:&lt;br />
<span class='line'>117</span>          * &lt;code>{ functionKey: &lt;em>functionKey&lt;/em>, shiftKey: &lt;em>shiftKey&lt;/em>, commandKey: &lt;em>commandKey&lt;/em>,
<span class='line'>118</span>          * colorIndex: &lt;em>colorIndex&lt;/em>, name: &lt;em>name&lt;/em>, expanded: &lt;em>expanded&lt;/em>, commands: &lt;em>commands&lt;/em> }&lt;/code>
<span class='line'>119</span>          * &lt;/p>
<span class='line'>120</span>          * &lt;p style="margin: 0.5em 0 0 5em;">
<span class='line'>121</span>          * &lt;code>&lt;em>functionKey&lt;/em>&lt;/code>: number&lt;br />
<span class='line'>122</span>          * &lt;code>&lt;em>shiftKey&lt;/em>&lt;/code>: boolean&lt;br />
<span class='line'>123</span>          * &lt;code>&lt;em>commandKey&lt;/em>&lt;/code>: boolean&lt;br />
<span class='line'>124</span>          * &lt;code>&lt;em>colorIndex&lt;/em>&lt;/code>: number&lt;br />
<span class='line'>125</span>          * &lt;code>&lt;em>name&lt;/em>&lt;/code>: string&lt;br />
<span class='line'>126</span>          * &lt;code>&lt;em>expanded&lt;/em>&lt;/code>: boolean&lt;br />
<span class='line'>127</span>          * &lt;code>&lt;em>commands&lt;/em>&lt;/code>: literal array [ ] of &lt;code>&lt;em>command&lt;/em>&lt;/code>
<span class='line'>128</span>          * &lt;/p>
<span class='line'>129</span>          * &lt;p style="margin: 0.5em 0 0 6.25em;">
<span class='line'>130</span>          * &lt;code>&lt;em>command&lt;/em>&lt;/code>: literal object with six or seven members: either&lt;br />
<span class='line'>131</span>          * &lt;code>{ expanded: &lt;em>expanded&lt;/em>, enabled: &lt;em>enabled&lt;/em>, withDialog: &lt;em>withDialog&lt;/em>, dialogOptions: &lt;em>dialogOptions&lt;/em>,
<span class='line'>132</span>          * eventId: &lt;em>eventId&lt;/em>, dictionaryName: &lt;em>dictionaryName&lt;/em> }&lt;/code> or&lt;br />
<span class='line'>133</span>          * &lt;code>{ expanded: &lt;em>expanded&lt;/em>, enabled: &lt;em>enabled&lt;/em>, withDialog: &lt;em>withDialog&lt;/em>, dialogOptions: &lt;em>dialogOptions&lt;/em>,
<span class='line'>134</span>          * eventId: &lt;em>eventId&lt;/em>, dictionaryName: &lt;em>dictionaryName&lt;/em>, actionDescriptor: &lt;em>actionDescriptor&lt;/em> }&lt;/code>&lt;br />
<span class='line'>135</span>          * &lt;/p>
<span class='line'>136</span>          * &lt;p style="margin: 0.5em 0 0 7.5em;">
<span class='line'>137</span>          * &lt;code>&lt;em>expanded&lt;/em>&lt;/code>: boolean&lt;br />
<span class='line'>138</span>          * &lt;code>&lt;em>enabled&lt;/em>&lt;/code>: boolean&lt;br />
<span class='line'>139</span>          * &lt;code>&lt;em>withDialog&lt;/em>&lt;/code>: boolean&lt;br />
<span class='line'>140</span>          * &lt;code>&lt;em>dialogOptions&lt;/em>&lt;/code>: number&lt;br />
<span class='line'>141</span>          * &lt;code>&lt;em>eventId&lt;/em>&lt;/code>: number&lt;br />
<span class='line'>142</span>          * &lt;code>&lt;em>dictionaryName&lt;/em>&lt;/code>: string&lt;br />
<span class='line'>143</span>          * &lt;code>&lt;em>actionDescriptor&lt;/em>&lt;/code>: ActionDescriptor object (optional)
<span class='line'>144</span>          * &lt;/p>
<span class='line'>145</span>          * @example
<span class='line'>146</span>          * function actionsFileFilter (f)
<span class='line'>147</span>          * {
<span class='line'>148</span>          *     return (f instanceof Folder) || jamActions.isActionsFile (f);
<span class='line'>149</span>          * }
<span class='line'>150</span>          * var select = (File.fs === "Macintosh") ? actionsFileFilter : "Actions Files:*.atn,All Files:*";
<span class='line'>151</span>          * var actionsFile = File.openDialog ("Select an actions file:", select);
<span class='line'>152</span>          * if (actionsFile !== null)
<span class='line'>153</span>          * {
<span class='line'>154</span>          *     var fileData = jamActions.&lt;strong>dataFromActionsFile&lt;/strong> (actionsFile);
<span class='line'>155</span>          *     if (typeof fileData === 'string')
<span class='line'>156</span>          *     {
<span class='line'>157</span>          *         alert (fileData + "\n" + "Actions file: “" + decodeURI (actionsFile.name) + "”");
<span class='line'>158</span>          *     }
<span class='line'>159</span>          *     else
<span class='line'>160</span>          *     {
<span class='line'>161</span>          *         alert ("Action set name: “" + fileData.actionSet.name + "”");
<span class='line'>162</span>          *         alert ("Number of actions: " + fileData.actionSet.actions.length);
<span class='line'>163</span>          *     }
<span class='line'>164</span>          * }
<span class='line'>165</span>          */</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT">        </span><span class="NAME">jamActions.dataFromActionsFile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">actionsFile</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">isPalette</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT">        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">byteCount</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bytes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">file.read</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">byteCount</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">intValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT">                </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">byteCount</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">   
<span class='line'>174</span>                     </span><span class="NAME">intValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">intValue</span><span class="WHIT"> </span><span class="PUNC">&lt;&lt;</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">bytes.charCodeAt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">intValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">readBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">byteCount</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">file.read</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">byteCount</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">readByteString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">stringLength</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">readBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">stringLength</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">readUnicodeString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">unicodeString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">unicodeLength</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">// Includes terminating null</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT">                </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">unicodeLength</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">unicodeChar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">unicodeChar</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT">                        </span><span class="NAME">unicodeString</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">String.fromCharCode</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">unicodeChar</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">unicodeString</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">readEventId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">eventId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">eventType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT">                </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">eventType</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'TEXT'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT">                        </span><span class="NAME">eventId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">app.stringIDToTypeID</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readByteString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'long'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT">                        </span><span class="NAME">eventId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">app.charIDToTypeID</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT">                    </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT">                        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"Unrecognized event type: '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">eventType</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">eventId</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipDouble</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT">                </span><span class="NAME">file.seek</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">8</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipDoubles</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">doubleCount</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">                </span><span class="NAME">file.seek</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">doubleCount</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipInt8</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT">                </span><span class="NAME">file.seek</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipInt16</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT">                </span><span class="NAME">file.seek</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipInt32</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT">                </span><span class="NAME">file.seek</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">4</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipInt64</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT">                </span><span class="NAME">file.seek</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">8</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">byteCount</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT">                </span><span class="NAME">file.seek</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">byteCount</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipByteString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">stringLength</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT">                </span><span class="NAME">skipBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">stringLength</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>263</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>264</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipUnicodeString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">unicodeLength</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">// Includes terminating null</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT">                </span><span class="NAME">skipBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">unicodeLength</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idLength</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idLength</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>276</span> </span><span class="WHIT">                    </span><span class="NAME">skipBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idLength</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT">                </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT">                    </span><span class="NAME">skipBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>282</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipClass</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">                </span><span class="NAME">skipUnicodeString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">// Class ID name (usually empty)</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT">                </span><span class="NAME">skipId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// Class ID</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipObject</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT">                </span><span class="NAME">skipClass</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>293</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">itemCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT">                </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">itemCount</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT">                    </span><span class="NAME">skipId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// Key ID</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT">                    </span><span class="NAME">skipItem</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipList</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">itemCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT">                </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">itemCount</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>306</span> </span><span class="WHIT">                    </span><span class="NAME">skipItem</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>309</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>310</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipItem</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">typeId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>313</span> </span><span class="WHIT">                </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">typeId</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT">                    </span><span class="COMM">// Reference</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'obj '</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT">                        </span><span class="NAME">skipReference</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT">                    </span><span class="COMM">// Object descriptor</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'Objc'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>321</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'GlbO'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>322</span> </span><span class="WHIT">                        </span><span class="NAME">skipObject</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>323</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>324</span> </span><span class="WHIT">                    </span><span class="COMM">// Class</span><span class="WHIT">
<span class='line'>325</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'type'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>326</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'GlbC'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>327</span> </span><span class="WHIT">                        </span><span class="NAME">skipClass</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>328</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>329</span> </span><span class="WHIT">                    </span><span class="COMM">// List</span><span class="WHIT">
<span class='line'>330</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'VlLs'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>331</span> </span><span class="WHIT">                        </span><span class="NAME">skipList</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>332</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>333</span> </span><span class="WHIT">                    </span><span class="COMM">// Double</span><span class="WHIT">
<span class='line'>334</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'doub'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>335</span> </span><span class="WHIT">                        </span><span class="NAME">skipDouble</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>336</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>337</span> </span><span class="WHIT">                    </span><span class="COMM">// Unit double</span><span class="WHIT">
<span class='line'>338</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'UntF'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>339</span> </span><span class="WHIT">                        </span><span class="NAME">skipBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">// Unit</span><span class="WHIT">
<span class='line'>340</span> </span><span class="WHIT">                        </span><span class="NAME">skipDouble</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">      </span><span class="COMM">// Double</span><span class="WHIT">
<span class='line'>341</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>342</span> </span><span class="WHIT">                    </span><span class="COMM">// String</span><span class="WHIT">
<span class='line'>343</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'TEXT'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT">                        </span><span class="NAME">skipUnicodeString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT">                    </span><span class="COMM">// Enumerated</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'enum'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT">                        </span><span class="NAME">skipId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// Enum type</span><span class="WHIT">
<span class='line'>349</span> </span><span class="WHIT">                        </span><span class="NAME">skipId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// Enum value</span><span class="WHIT">
<span class='line'>350</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>351</span> </span><span class="WHIT">                    </span><span class="COMM">// Integer</span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'long'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT">                        </span><span class="NAME">skipInt32</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">// Signed integer</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT">                    </span><span class="COMM">// Large integer</span><span class="WHIT">
<span class='line'>356</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'comp'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>357</span> </span><span class="WHIT">                        </span><span class="NAME">skipInt64</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">// Signed integer</span><span class="WHIT">
<span class='line'>358</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>359</span> </span><span class="WHIT">                    </span><span class="COMM">// Boolean</span><span class="WHIT">
<span class='line'>360</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'bool'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>361</span> </span><span class="WHIT">                        </span><span class="NAME">skipInt8</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>362</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>363</span> </span><span class="WHIT">                    </span><span class="COMM">// File alias</span><span class="WHIT">
<span class='line'>364</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'alis'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>365</span> </span><span class="WHIT">                        </span><span class="NAME">skipByteString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>366</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>367</span> </span><span class="WHIT">                    </span><span class="COMM">// File path</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'Pth '</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>369</span> </span><span class="WHIT">                        </span><span class="NAME">skipByteString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>371</span> </span><span class="WHIT">                    </span><span class="COMM">// Raw data</span><span class="WHIT">
<span class='line'>372</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'tdta'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>373</span> </span><span class="WHIT">                        </span><span class="NAME">skipByteString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>374</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>375</span> </span><span class="WHIT">                    </span><span class="COMM">// Object array (undocumented; used for polygonal selections...)</span><span class="WHIT">
<span class='line'>376</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'ObAr'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>377</span> </span><span class="WHIT">                        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">objCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>378</span> </span><span class="WHIT">                        </span><span class="NAME">skipClass</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>379</span> </span><span class="WHIT">                        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">itemCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>380</span> </span><span class="WHIT">                        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">itemCount</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>381</span> </span><span class="WHIT">                        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>382</span> </span><span class="WHIT">                            </span><span class="NAME">skipId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">      </span><span class="COMM">// Key ID</span><span class="WHIT">
<span class='line'>383</span> </span><span class="WHIT">                            </span><span class="NAME">skipInt32</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">// Item type: 'UnFl' (undocumented; assumed to be "Unit floats")...</span><span class="WHIT">
<span class='line'>384</span> </span><span class="WHIT">                            </span><span class="NAME">skipInt32</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">// Unit ID</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT">                            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">doublesCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// Should be equal to objCount!</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT">                            </span><span class="NAME">skipDoubles</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">doublesCount</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>387</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>389</span> </span><span class="WHIT">                    </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>390</span> </span><span class="WHIT">                        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"Unrecognized item type: '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">typeId</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>393</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">skipReference</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">itemCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>398</span> </span><span class="WHIT">                </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">itemCount</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">itemIndex</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>399</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>400</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">formId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBytes</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>401</span> </span><span class="WHIT">                    </span><span class="NAME">skipClass</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">// Desired class</span><span class="WHIT">
<span class='line'>402</span> </span><span class="WHIT">                    </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">formId</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>403</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>404</span> </span><span class="WHIT">                        </span><span class="COMM">// Class</span><span class="WHIT">
<span class='line'>405</span> </span><span class="WHIT">                        </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'Clss'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>406</span> </span><span class="WHIT">                            </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>407</span> </span><span class="WHIT">                        </span><span class="COMM">// Property</span><span class="WHIT">
<span class='line'>408</span> </span><span class="WHIT">                        </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'prop'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>409</span> </span><span class="WHIT">                            </span><span class="NAME">skipId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>410</span> </span><span class="WHIT">                            </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>411</span> </span><span class="WHIT">                        </span><span class="COMM">// Enumerated</span><span class="WHIT">
<span class='line'>412</span> </span><span class="WHIT">                        </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'Enmr'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>413</span> </span><span class="WHIT">                            </span><span class="NAME">skipId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// Enum type</span><span class="WHIT">
<span class='line'>414</span> </span><span class="WHIT">                            </span><span class="NAME">skipId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// Enum value</span><span class="WHIT">
<span class='line'>415</span> </span><span class="WHIT">                            </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>416</span> </span><span class="WHIT">                        </span><span class="COMM">// Offset</span><span class="WHIT">
<span class='line'>417</span> </span><span class="WHIT">                        </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'rele'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>418</span> </span><span class="WHIT">                            </span><span class="NAME">skipInt32</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">// Signed integer</span><span class="WHIT">
<span class='line'>419</span> </span><span class="WHIT">                            </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>420</span> </span><span class="WHIT">                        </span><span class="COMM">// Identifier</span><span class="WHIT">
<span class='line'>421</span> </span><span class="WHIT">                        </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'Idnt'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>422</span> </span><span class="WHIT">                            </span><span class="NAME">skipInt32</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">// Unsigned integer</span><span class="WHIT">
<span class='line'>423</span> </span><span class="WHIT">                            </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>424</span> </span><span class="WHIT">                        </span><span class="COMM">// Index</span><span class="WHIT">
<span class='line'>425</span> </span><span class="WHIT">                        </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'indx'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>426</span> </span><span class="WHIT">                            </span><span class="NAME">skipInt32</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">// Unsigned integer</span><span class="WHIT">
<span class='line'>427</span> </span><span class="WHIT">                            </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>428</span> </span><span class="WHIT">                        </span><span class="COMM">// Name</span><span class="WHIT">
<span class='line'>429</span> </span><span class="WHIT">                        </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'name'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>430</span> </span><span class="WHIT">                            </span><span class="NAME">skipUnicodeString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>431</span> </span><span class="WHIT">                            </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>432</span> </span><span class="WHIT">                        </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>433</span> </span><span class="WHIT">                            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"Unrecognized item form: '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">formId</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>434</span> </span><span class="WHIT">                            </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>435</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>436</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>437</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">readActionDescriptor</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>440</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">start</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">file.tell</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT">                </span><span class="NAME">skipObject</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">end</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">file.tell</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT">                </span><span class="NAME">file.seek</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">start</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">stream</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"\x00\x00\x00\x10"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">file.read</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">end</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">start</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actionDescriptor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActionDescriptor</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>447</span> </span><span class="WHIT">                </span><span class="NAME">actionDescriptor.fromStream</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">stream</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>448</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">actionDescriptor</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>449</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>450</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>451</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">parseActionSet</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>452</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>453</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actionSet</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT">                </span><span class="NAME">actionSet.name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localize</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readUnicodeString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT">                </span><span class="NAME">actionSet.expanded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>456</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actionCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>457</span> </span><span class="WHIT">                </span><span class="NAME">actionSet.actions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>458</span> </span><span class="WHIT">                </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actionIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">actionIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">actionCount</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">actionIndex</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">action</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT">                    </span><span class="NAME">action.functionKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT">                    </span><span class="NAME">action.shiftKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">                    </span><span class="NAME">action.commandKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT">                    </span><span class="NAME">action.colorIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT">                    </span><span class="NAME">action.name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localize</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readUnicodeString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT">                    </span><span class="NAME">action.expanded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">commandCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>468</span> </span><span class="WHIT">                    </span><span class="NAME">action.commands</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT">                    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">commandIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">commandIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">commandCount</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">commandIndex</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>470</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>471</span> </span><span class="WHIT">                        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">command</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>472</span> </span><span class="WHIT">                        </span><span class="NAME">command.expanded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>473</span> </span><span class="WHIT">                        </span><span class="NAME">command.enabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>474</span> </span><span class="WHIT">                        </span><span class="NAME">command.withDialog</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>475</span> </span><span class="WHIT">                        </span><span class="NAME">command.dialogOptions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>476</span> </span><span class="WHIT">                        </span><span class="NAME">command.eventId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readEventId</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>477</span> </span><span class="WHIT">                        </span><span class="NAME">command.dictionaryName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readByteString</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>478</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>479</span> </span><span class="WHIT">                        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>480</span> </span><span class="WHIT">                            </span><span class="NAME">command.actionDescriptor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readActionDescriptor</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>481</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>482</span> </span><span class="WHIT">                        </span><span class="NAME">action.commands.push</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">command</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>483</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>484</span> </span><span class="WHIT">                    </span><span class="NAME">actionSet.actions.push</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">action</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>485</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>486</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">actionSet</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>487</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>488</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>489</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>490</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">actionsFile</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>491</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>492</span> </span><span class="WHIT">                </span><span class="NAME">file</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">File</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">actionsFile</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>493</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>494</span> </span><span class="WHIT">            </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">actionsFile</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">File</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>495</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>496</span> </span><span class="WHIT">                </span><span class="NAME">file</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">actionsFile</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>497</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>498</span> </span><span class="WHIT">            </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>499</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>500</span> </span><span class="WHIT">                </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">'\n[jamActions.dataFromActionsFile] Invalid argument'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>501</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>502</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>503</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fileData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>504</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file.open</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"r"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>505</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>506</span> </span><span class="WHIT">                </span><span class="KEYW">try</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">                    </span><span class="NAME">file.encoding</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'BINARY'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>509</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fileVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>510</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">fileVersion</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>511</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT">                        </span><span class="NAME">fileData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT">                        </span><span class="NAME">fileData.version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">fileVersion</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isPalette</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>515</span> </span><span class="WHIT">                        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>516</span> </span><span class="WHIT">                            </span><span class="NAME">fileData.actionSets</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>517</span> </span><span class="WHIT">                            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actionSetCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">readBEInt</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT">                            </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actionSetIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">actionSetIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">actionSetCount</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">actionSetIndex</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT">                            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>520</span> </span><span class="WHIT">                                </span><span class="NAME">fileData.actionSets.push</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">parseActionSet</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>521</span> </span><span class="WHIT">                            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>522</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>523</span> </span><span class="WHIT">                        </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>524</span> </span><span class="WHIT">                        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>525</span> </span><span class="WHIT">                            </span><span class="NAME">fileData.actionSet</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseActionSet</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>526</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>527</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>528</span> </span><span class="WHIT">                    </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>529</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>530</span> </span><span class="WHIT">                        </span><span class="NAME">fileData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"Unsupported actions file version: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">fileVersion</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>531</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>532</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>533</span> </span><span class="WHIT">                </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>534</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>535</span> </span><span class="WHIT">                    </span><span class="NAME">fileData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>536</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>537</span> </span><span class="WHIT">                </span><span class="KEYW">finally</span><span class="WHIT">
<span class='line'>538</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>539</span> </span><span class="WHIT">                    </span><span class="NAME">file.close</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>542</span> </span><span class="WHIT">            </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT">                </span><span class="NAME">fileData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"Cannot open file"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">fileData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>547</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>548</span> </span><span class="WHIT">        </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>549</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>550</span>          * @description Test if a command is a play of a local action (belonging to the same action set).
<span class='line'>551</span>          * @param {Object} command Command data structure
<span class='line'>552</span>          * @param {String} actionSetName Action set name
<span class='line'>553</span>          * @returns {Array|Null} Array of three items: [ localActionName, localCommandIndex, localContinue ] if true, null if false
<span class='line'>554</span>          * @see jamActions.dataFromActionsFile
<span class='line'>555</span>          * @example
<span class='line'>556</span>          * function executeCommand (command)
<span class='line'>557</span>          * {
<span class='line'>558</span>          *     if (command.enabled)
<span class='line'>559</span>          *     {
<span class='line'>560</span>          *         var playCommand = jamActions.&lt;strong>isLocalPlayCommand&lt;/strong> (command, actionSet.name);
<span class='line'>561</span>          *         if (playCommand !== null)
<span class='line'>562</span>          *         {
<span class='line'>563</span>          *             jamActions.traverseAction (actionSet, playCommand[0], playCommand[1], playCommand[2]);
<span class='line'>564</span>          *         }
<span class='line'>565</span>          *         else
<span class='line'>566</span>          *         {
<span class='line'>567</span>          *             var dialogMode = jamActions.determineDialogMode (command);
<span class='line'>568</span>          *             app.executeAction (command.eventId, command.actionDescriptor, dialogMode);
<span class='line'>569</span>          *         }
<span class='line'>570</span>          *     }
<span class='line'>571</span>          * }
<span class='line'>572</span>          * jamActions.setCommandHandler (executeCommand);
<span class='line'>573</span>          * jamActions.traverseAction (fileData.actionSet, actionName);
<span class='line'>574</span>          */</span><span class="WHIT">
<span class='line'>575</span> </span><span class="WHIT">        </span><span class="NAME">jamActions.isLocalPlayCommand</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">command</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">actionSetName</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>576</span> </span><span class="WHIT">        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>577</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">localPlayCommand</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>578</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">command.eventId</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">app.stringIDToTypeID</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"play"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>579</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>580</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">targetId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">app.stringIDToTypeID</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"target"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>581</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">command.actionDescriptor.hasKey</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">targetId</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>582</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>583</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">localReference</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">command.actionDescriptor.getReference</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">targetId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>584</span> </span><span class="WHIT">                    </span><span class="KEYW">do</span><span class="WHIT">
<span class='line'>585</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>586</span> </span><span class="WHIT">                        </span><span class="COMM">// var desiredClassId = localReference.getDesiredClass ();</span><span class="WHIT">
<span class='line'>587</span> </span><span class="WHIT">                        </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">desiredClassId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localReference.getDesiredClass</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>588</span> </span><span class="WHIT">                        </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">desiredClassId</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>589</span> </span><span class="WHIT">                        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>590</span> </span><span class="WHIT">                            </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">app.stringIDToTypeID</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"command"</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>591</span> </span><span class="WHIT">                                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">localCommandIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localReference.getIndex</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>592</span> </span><span class="WHIT">                                </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>593</span> </span><span class="WHIT">                            </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">app.stringIDToTypeID</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"action"</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>594</span> </span><span class="WHIT">                                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">localActionName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localReference.getName</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>595</span> </span><span class="WHIT">                                </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>596</span> </span><span class="WHIT">                            </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">app.stringIDToTypeID</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"actionSet"</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>597</span> </span><span class="WHIT">                                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">localActionSetName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localReference.getName</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>598</span> </span><span class="WHIT">                                </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>599</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>600</span> </span><span class="WHIT">                        </span><span class="NAME">localReference</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localReference.getContainer</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>601</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>602</span> </span><span class="WHIT">                    </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">localReference</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>603</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>604</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">continueId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">app.stringIDToTypeID</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"continue"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>605</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">command.actionDescriptor.hasKey</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">continueId</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>606</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>607</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">localContinue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">command.actionDescriptor.getBoolean</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">continueId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>608</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>609</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">localActionSetName</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">localActionSetName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">actionSetName</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>610</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>611</span> </span><span class="WHIT">                    </span><span class="NAME">localPlayCommand</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">localActionName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">localCommandIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">localContinue</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>612</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>613</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>614</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">localPlayCommand</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>615</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>616</span> </span><span class="WHIT">        </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>617</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>618</span>          * @description Determine dialog mode depending on command settings
<span class='line'>619</span>          * @param {Object} command Command data structure
<span class='line'>620</span>          * @returns {Object} Dialog mode: either DialogModes.ALL or DialogModes.NO
<span class='line'>621</span>          * @see jamActions.dataFromActionsFile
<span class='line'>622</span>          * @example
<span class='line'>623</span>          * app.executeAction (command.eventId, command.actionDescriptor, jamActions.&lt;strong>determineDialogMode&lt;/strong> (command));
<span class='line'>624</span>          */</span><span class="WHIT">
<span class='line'>625</span> </span><span class="WHIT">        </span><span class="NAME">jamActions.determineDialogMode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">command</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>626</span> </span><span class="WHIT">        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>627</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dialogMode</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>628</span> </span><span class="WHIT">            </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">command.dialogOptions</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>629</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>630</span> </span><span class="WHIT">                </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>631</span> </span><span class="WHIT">                    </span><span class="NAME">dialogMode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">command.withDialog</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">DialogModes.ALL</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">DialogModes.NO</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>632</span> </span><span class="WHIT">                    </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>633</span> </span><span class="WHIT">                </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>634</span> </span><span class="WHIT">                    </span><span class="NAME">dialogMode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">DialogModes.NO</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>635</span> </span><span class="WHIT">                    </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>636</span> </span><span class="WHIT">                </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>637</span> </span><span class="WHIT">                </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>638</span> </span><span class="WHIT">                    </span><span class="NAME">dialogMode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">DialogModes.ALL</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>639</span> </span><span class="WHIT">                    </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>640</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>641</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">dialogMode</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>642</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>643</span> </span><span class="WHIT">        </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>644</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">globalCommandHandler</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>645</span> </span><span class="WHIT">        </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>646</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>647</span>          * @description Set the global command handler [available in CS2 or later].&lt;br />
<span class='line'>648</span>          * @param {Function} commandHandler Global command handler: function to be called by jamActions.traverseAction () for each command in the action
<span class='line'>649</span>          * @see jamActions.traverseAction
<span class='line'>650</span>          * @example
<span class='line'>651</span>          * function debugCommand (command)
<span class='line'>652</span>          * {
<span class='line'>653</span>          *     $.writeln ("Dictionary Name: " + command.dictionaryName);
<span class='line'>654</span>          *     $.writeln ("Enabled: " + command.enabled);
<span class='line'>655</span>          *     $.writeln ("With Dialog: " + command.withDialog);
<span class='line'>656</span>          *     $.writeln ();
<span class='line'>657</span>          * }
<span class='line'>658</span>          * jamActions.&lt;strong>setCommandHandler&lt;/strong> (debugCommand);
<span class='line'>659</span>          * jamActions.traverseAction (fileData.actionSet, 0);
<span class='line'>660</span>          */</span><span class="WHIT">
<span class='line'>661</span> </span><span class="WHIT">        </span><span class="NAME">jamActions.setCommandHandler</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">commandHandler</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>662</span> </span><span class="WHIT">        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>663</span> </span><span class="WHIT">            </span><span class="NAME">globalCommandHandler</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">commandHandler</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>664</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>665</span> </span><span class="WHIT">        </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>666</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>667</span>          * @description Traverse all the commands of a specific action of an action set data structure obtained from a converted actions file (*.atn)
<span class='line'>668</span>          * [available in CS2 or later].&lt;br />
<span class='line'>669</span>          * The global command handler set by jamActions.setCommandHandler () is called for each command in the action.
<span class='line'>670</span>          * @param {Object} actionSet Action set data structure in literal object format
<span class='line'>671</span>          * @param {String|Number} actionLocator Action locator: action name or action index (0-based)
<span class='line'>672</span>          * @param {Number} [fromCommandIndex] Index (0-based) of command to start from
<span class='line'>673</span>          * @param {Boolean} [continuePlay] Continue to play remaining commands after the fromCommandIndex index
<span class='line'>674</span>          * @see jamActions.dataFromActionsFile
<span class='line'>675</span>          * @see jamActions.setCommandHandler
<span class='line'>676</span>          * @example
<span class='line'>677</span>          * Folder.current = new Folder ("~/JSON Action Manager/tests/resources/");
<span class='line'>678</span>          * jamEngine.jsonPlay ("open", { "target": { "&lt;path&gt;": "Factory.jpg" } });
<span class='line'>679</span>          * var actionsFilePath = "Cross Processing.atn";
<span class='line'>680</span>          * var fileData = jamActions.dataFromActionsFile (actionsFilePath);
<span class='line'>681</span>          * if (typeof fileData === 'string')
<span class='line'>682</span>          * {
<span class='line'>683</span>          *     alert (fileData + "\n" + "Actions file: “" + actionsFilePath + "”");
<span class='line'>684</span>          * }
<span class='line'>685</span>          * else
<span class='line'>686</span>          * {
<span class='line'>687</span>          *     function executeCommand (command)
<span class='line'>688</span>          *     {
<span class='line'>689</span>          *         if (command.enabled)
<span class='line'>690</span>          *         {
<span class='line'>691</span>          *             var dialogMode = jamActions.determineDialogMode (command);
<span class='line'>692</span>          *             app.executeAction (command.eventId, command.actionDescriptor, dialogMode);
<span class='line'>693</span>          *         }
<span class='line'>694</span>          *     }
<span class='line'>695</span>          *     jamActions.setCommandHandler (executeCommand);
<span class='line'>696</span>          *     jamActions.&lt;strong>traverseAction&lt;/strong> (fileData.actionSet, "Cross Process 2");
<span class='line'>697</span>          * }
<span class='line'>698</span>          */</span><span class="WHIT">
<span class='line'>699</span> </span><span class="WHIT">        </span><span class="NAME">jamActions.traverseAction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">actionSet</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">actionLocator</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fromCommandIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">continuePlay</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>700</span> </span><span class="WHIT">        </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>701</span> </span><span class="WHIT">            </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">handleCommands</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">commands</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>702</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>703</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">commandMax</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">continuePlay</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">commands.length</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">fromCommandIndex</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>704</span> </span><span class="WHIT">                </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">commandIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">fromCommandIndex</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">commandIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">commandMax</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">commandIndex</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>705</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>706</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">globalCommandHandler</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>707</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>708</span> </span><span class="WHIT">                        </span><span class="NAME">globalCommandHandler</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">commands</span><span class="PUNC">[</span><span class="NAME">commandIndex</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>709</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>710</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>711</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>712</span> </span><span class="WHIT">            </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>713</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">fromCommandIndex</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>714</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>715</span> </span><span class="WHIT">                </span><span class="NAME">fromCommandIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>716</span> </span><span class="WHIT">                </span><span class="NAME">continuePlay</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>717</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>718</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">actionSet.actions</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>719</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">actionLocator</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>720</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>721</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actionName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">actionLocator</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>722</span> </span><span class="WHIT">                </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actionIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">actionIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">actions.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">actionIndex</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>723</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>724</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">action</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">actions</span><span class="PUNC">[</span><span class="NAME">actionIndex</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>725</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">action.name</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">actionName</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>726</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>727</span> </span><span class="WHIT">                        </span><span class="NAME">handleCommands</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">action.commands</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>728</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>729</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>730</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>731</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>732</span> </span><span class="WHIT">            </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">actionLocator</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>733</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>734</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actionIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">actionLocator</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>735</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">actionIndex</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">actionIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">actions.length</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>736</span> </span><span class="WHIT">                </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>737</span> </span><span class="WHIT">                    </span><span class="NAME">handleCommands</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">actions</span><span class="PUNC">[</span><span class="NAME">actionIndex</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">commands</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>738</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>739</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>740</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>741</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>742</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>743</span> 
<span class='line'>744</span> </span><span class="COMM">//------------------------------------------------------------------------------</span><span class="WHIT">
<span class='line'>745</span> 
<span class='line'>746</span> </span></pre></body></html>